﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>状态栏的跑马灯效果</title>
    <script type="text/javascript" language="JavaScript">
        let msg="欢迎光临北京特色奥运会，期待志愿者的参与！";
        let interval = 400;
        seq = 0;
        
        function marquee(){
            len = msg.length;
            window.status = msg.substring(0,seq + 1);   // 逐字增加文本
            seq++;
            if(seq >= len){
                seq = 0;    // 如果文本已经显示完，则从头开始
            }
            window.setTimeout("marquee();",interval);
        }
        
    </script>
</head>
<body onload="marquee()">

</body>
</html>